package com.fr.base;

import com.fr.base.background.Background;
import com.fr.base.core.ComparatorUtils;
import com.fr.base.file.ConfigManager;
import java.awt.Color;
import java.io.InvalidObjectException;
import java.text.Format;
import java.util.Map;
import java.util.WeakHashMap;

public class NameStyle extends Style
{
  private static final long serialVersionUID = 3025586536902826179L;
  private static Map initializeStyle = new WeakHashMap();
  private String _name;
  private transient Style _style;

  public static NameStyle getInstance(String paramString)
  {
    Object localObject = initializeStyle.get(paramString);
    if (localObject instanceof NameStyle)
      return ((NameStyle)localObject);
    initializeStyle.put(paramString, new NameStyle(paramString));
    return getInstance(paramString);
  }

  private NameStyle(String paramString)
  {
    this._name = paramString;
  }

  public String getName()
  {
    return this._name;
  }

  public void refreshStyle()
  {
    this._style = FRContext.getConfigManager().getStyle(this._name);
    if (this._style == null)
      this._style = Style.DEFAULT_STYLE;
  }

  private Style createStyle()
  {
    refreshStyle();
    return this._style;
  }

  public Style deriveBackground(Background paramBackground)
  {
    return createStyle().deriveBackground(paramBackground);
  }

  public Style deriveBorder(int paramInt1, Color paramColor1, int paramInt2, Color paramColor2, int paramInt3, Color paramColor3, int paramInt4, Color paramColor4)
  {
    return createStyle().deriveBorder(paramInt1, paramColor1, paramInt2, paramColor2, paramInt3, paramColor3, paramInt4, paramColor4);
  }

  public Style deriveBorderBackgroundNone()
  {
    return createStyle().deriveBorderBackgroundNone();
  }

  public Style deriveBorderBottom(int paramInt, Color paramColor)
  {
    return createStyle().deriveBorderBottom(paramInt, paramColor);
  }

  public Style deriveBorderLeft(int paramInt, Color paramColor)
  {
    return createStyle().deriveBorderLeft(paramInt, paramColor);
  }

  public Style deriveBorderRight(int paramInt, Color paramColor)
  {
    return createStyle().deriveBorderRight(paramInt, paramColor);
  }

  public Style deriveBorderTop(int paramInt, Color paramColor)
  {
    return createStyle().deriveBorderTop(paramInt, paramColor);
  }

  public Style deriveFormat(Format paramFormat)
  {
    return createStyle().deriveFormat(paramFormat);
  }

  public Style deriveFRFont(FRFont paramFRFont)
  {
    return createStyle().deriveFRFont(paramFRFont);
  }

  public Style deriveHorizontalAlignment(int paramInt)
  {
    return createStyle().deriveHorizontalAlignment(paramInt);
  }

  public Style deriveImageLayout(int paramInt)
  {
    return createStyle().deriveImageLayout(paramInt);
  }

  public Style deriveLineSpacing(int paramInt)
  {
    return createStyle().deriveLineSpacing(paramInt);
  }

  public Style derivePadding(int paramInt1, int paramInt2)
  {
    return createStyle().derivePadding(paramInt1, paramInt2);
  }

  public Style derivePaddingLeft(int paramInt)
  {
    return createStyle().derivePaddingLeft(paramInt);
  }

  public Style derivePaddingRight(int paramInt)
  {
    return createStyle().derivePaddingRight(paramInt);
  }

  public Style deriveRotation(int paramInt)
  {
    return createStyle().deriveRotation(paramInt);
  }

  public Style deriveSpacingAfter(int paramInt)
  {
    return createStyle().deriveSpacingAfter(paramInt);
  }

  public Style deriveSpacingBefore(int paramInt)
  {
    return createStyle().deriveSpacingBefore(paramInt);
  }

  public Style deriveTextDirection(int paramInt)
  {
    return createStyle().deriveTextDirection(paramInt);
  }

  public Style deriveTextStyle(int paramInt)
  {
    return createStyle().deriveTextStyle(paramInt);
  }

  public Style deriveVerticalAlignment(int paramInt)
  {
    return createStyle().deriveVerticalAlignment(paramInt);
  }

  public Style deriveVerticalText(int paramInt)
  {
    return createStyle().deriveVerticalText(paramInt);
  }

  public Background getBackground()
  {
    return createStyle().getBackground();
  }

  public int getBorderBottom()
  {
    return createStyle().getBorderBottom();
  }

  public Color getBorderBottomColor()
  {
    return createStyle().getBorderBottomColor();
  }

  public int getBorderLeft()
  {
    return createStyle().getBorderLeft();
  }

  public Color getBorderLeftColor()
  {
    return createStyle().getBorderLeftColor();
  }

  public int getBorderRight()
  {
    return createStyle().getBorderRight();
  }

  public Color getBorderRightColor()
  {
    return createStyle().getBorderRightColor();
  }

  public int getBorderTop()
  {
    return createStyle().getBorderTop();
  }

  public Color getBorderTopColor()
  {
    return createStyle().getBorderTopColor();
  }

  public Format getFormat()
  {
    return createStyle().getFormat();
  }

  public FRFont getFRFont()
  {
    return createStyle().getFRFont();
  }

  public int getHorizontalAlignment()
  {
    return createStyle().getHorizontalAlignment();
  }

  public int getImageLayout()
  {
    return createStyle().getImageLayout();
  }

  public byte getLineSpacing()
  {
    return createStyle().getLineSpacing();
  }

  public String getContentClsCss()
  {
    return createStyle().getContentClsCss();
  }

  public Map getContentStyleCssMap()
  {
    return createStyle().getContentStyleCssMap();
  }

  public String getBorderClsCss()
  {
    return createStyle().getBorderClsCss();
  }

  public Map getBorderStyleCssMap()
  {
    return createStyle().getBorderStyleCssMap();
  }

  public int getPaddingLeft()
  {
    return createStyle().getPaddingLeft();
  }

  public int getPaddingRight()
  {
    return createStyle().getPaddingRight();
  }

  public int getRotation()
  {
    return createStyle().getRotation();
  }

  public byte getSpacingAfter()
  {
    return createStyle().getSpacingAfter();
  }

  public byte getSpacingBefore()
  {
    return createStyle().getSpacingBefore();
  }

  public int getTextDirection()
  {
    return createStyle().getTextDirection();
  }

  public int getTextStyle()
  {
    return createStyle().getTextStyle();
  }

  public int getVerticalAlignment()
  {
    return createStyle().getVerticalAlignment();
  }

  public int getVerticalText()
  {
    return createStyle().getVerticalText();
  }

  public int hashCode()
  {
    return ((this._name == null) ? 0 : this._name.hashCode());
  }

  public boolean equals(Object paramObject)
  {
    if (paramObject == this)
      return true;
    if (!(paramObject instanceof NameStyle))
      return false;
    return ComparatorUtils.equals(this._name, ((NameStyle)paramObject)._name);
  }

  public Object clone()
    throws CloneNotSupportedException
  {
    return this;
  }

  protected Object readResolve()
    throws InvalidObjectException
  {
    if (getClass() != NameStyle.class)
      throw new InvalidObjectException("subclass didn't correctly implement readResolve");
    Object localObject = initializeStyle.get(this._name);
    if (!(localObject instanceof NameStyle))
    {
      localObject = this;
      initializeStyle.put(this._name, this);
    }
    return localObject;
  }
}